<template>
  <div class="about">
    <h1>This is an provide-inject page</h1>
  </div>
  <injectView />
</template>
<script>
import { computed } from 'vue-demi';
import injectView from './InjectView.vue'

export default {
  data() {
    return {
      user: []
    }
  },
  created() {
    this.user = [{
      name: '小明',
      age: 30,
    },
    {
      name: '小红',
      age: 29,
    }
    ];

    var computedVal = computed(() => {
      return this.user;
    })
    //.value;
    console.log("computedVal", computedVal);
    // console.log(this.user);

    // this.user.name = '小明';
    // this.user.age = 30;
  },
  provide() {
    return {
      user: computed(() => this.user)
    }

  },
  components: {
    injectView
  }
}
</script>
<style></style>
